﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SWGeneracionE.Models.Repositories
{

    public class webpages_MenuRepository : GenericRepository<GEEntities, webpages_Menu>
    {

        public webpages_MenuRepository(GEEntities context)
            : base(context)
        {

        }

        public List<webpages_Menu> GetMenuByRol(string strRol)
		{
            var query = from menu in Context.webpages_Menu 
                        join menurol in Context.webpages_MenuRol on menu.IdMenu equals menurol.IdMenu 
                        where menurol.Rol == strRol 
                        orderby menu.Padre, menu.Orden
                        select menu;
            return query.ToList();
		}
    }

}


